import request from "@/api/index"

export default {
  /**
   * @description: 添加 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  add (params) {
    const url = "/task/feedMachine/add"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 编辑 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  edit (params) {
    const url = "/task/feedMachine/edit"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 单个删除 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delById (params) {
    const url = "/task/feedMachine/delById"
    return request.get(url, params)
  },
  /**
   * @description: 单个删除 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delListById (params) {
    const url = "/task/feedMachine/delListById"
    return request.get(url, params)
  },
  /**
   * @description: 条件查询 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
  queryByCondition (params) {
    const url = "/task/feedMachine/queryByCondition"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 分页查询 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
  queryPageByCondition (params) {
    const url = "/task/feedMachine/queryPageByCondition"
    return request.post(url, {
      ...params
    })
  },
  /**
  * @description: 获取关联设备 *代表必填
  * @param {Object} params *
  * @param {String/Number} page *
  * @param {String/Number} size *
  * @return {Object}
  */
  queryByCompanyMark (params) {
    const url = "/iot/iotPlatform/queryRtuByCompanyMark"
    return request.get(url, params)
  },
  /**
     * @description: 分页查询 *代表必填
     * @param {Object} params *
     * @param {String/Number} page *
     * @param {String/Number} size *
     * @return {Object}
     */
  queryConfigByCondition (params) {
    const url = "/task/feedMachineConfigDataItem/queryByCondition"
    return request.post(url, {
      ...params
    })
  },
  /**
  * @description: 投料机状态 *代表必填
  * @param {Object} params *
  * @param {String/Number} page *
  * @param {String/Number} size *
  * @return {Object}
  */
  changeFeedStatus (params) {
    const url = "/task/feedMachine/changeStatus"
    return request.post(url, {
      ...params
    })
  },

  /**
       * @description: 保存配置 *代表必填
       * @param {Object} params *
       * @param {String/Number} page *
       * @param {String/Number} size *
       * @return {Object}
       */
  saveConfig (params) {
    const url = "/task/feedMachineConfig/updateConfig"
    return request.post(url, {
      ...params
    })
  },
  /**
     * @description: 分页查询 *代表必填
     * @param {Object} params *
     * @param {String/Number} page *
     * @param {String/Number} size *
     * @return {Object}
     */
  queryConfigByFeedMachineId (params) {
    const url = "/task/feedMachineConfig/queryConfigByFeedMachineId"
    return request.get(url, params)
  },
}
